FROM ubuntu
MAINTAINER  571288304@qq.com
ADD jdk-8u131-linux-x64.tar.gz /usr/local/
ADD apache-tomcat-8.0.45.tar.gz /usr/local/
ENV JAVA_HOME=/usr/local/jdk1.8.0_131
ENV JAVA_BIN=/usr/local/jdk1.8.0_131/bin
ENV JRE_HOME=/usr/local/jdk1.8.0_131/jre
ENV CLASSPATH=/usr/local/jdk1.8.0_131/jre/lib:/usr/local/jdk1.8.0_131/lib:/usr/local/jdk1.8.0_131/jre/lib/charsets.jar
ENV PATH=$PATH:/usr/local/jdk1.8.0_131/bin:/usr/local/jdk1.8.0_131/jre/bin
ENV JAVA_OPTS="$JAVA_OPTS -Duser.timezone=Asia/Shanghai"
ADD jenkins.war /usr/local/apache-tomcat-8.0.45/webapps/
ENV JENKINS_HOME=/var/jenkins_home
RUN apt-get update && apt-get install -y \
wget \
curl \
git 
ADD nvm /root/.nvm/
RUN chmod -R 777 /root/.nvm/
RUN bash /root/.nvm/install.sh
RUN export NVM_DIR="$HOME/.nvm"
RUN echo "[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh" >> $HOME/.bashrc
RUN bash -i -c "nvm install stable" 
RUN bash -i -c "npm install -g cnpm --registry=https://registry.npm.taobao.org"
RUN bash -i -c "npm i npm@3.10.10 -g"
RUN apt-get clean
# expose tomcat port
EXPOSE 8080
ENTRYPOINT ["/usr/local/apache-tomcat-8.0.45/bin/catalina.sh"]
CMD ["run"]
